const fs = require("fs");
const getFile = (path) => {
    return new Promise(function (resolve, reject) {
        fs.readFile(path, function (err, data) {
            if (err) {
                reject(err);
            }
            resolve(data.toString());//buffer对象需转成字符串
        })
    })
}
module.exports = { getFile };